#ifndef __KD_TREE__
#define __KD_TREE__
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;

class Node{
	public:
		int location;
		int p, l, r;
		Node() {}
}; 
 
class Point{
	public:
		int id, x, y;
		Point() {}
		Point(int id, int x, int y): id(id), x(x), y(y) {}
		bool operator < (const Point &p) const {
			return id < p.id;
		}
		
	void print(){
		printf("%d\n", id);//使用比cout更快的printf函数 
	}
};

inline 
bool lessX(const Point &p1, const Point &p2) { return p1.x < p2.x; }

inline
bool lessY(const Point &p1, const Point &p2) { return p1.y < p2.y; }
 
int makeKDTree(int l, int r, int depth);
 
void find(int v, int sx, int tx, int sy, int ty, int depth, vector<Point> &ans);


#endif